﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Com.Binaria.SISCOB.Web.View;
using Com.Binaria.SISCOB.Web.Presenter;
using System.Text;

namespace Com.Binaria.SISCOB.Web
{
    public partial class Importar : System.Web.UI.Page, IImportarView
    {

        private ImportarPresenter presenter;

        protected void Page_Load(object sender, EventArgs e)
        {
            ctlRutaMayor.Text = ConfigurationManager.AppSettings.Get("RUTAMAYOR");
            ctlRutaCartola.Text = ConfigurationManager.AppSettings.Get("RUTACARTOLA");

        }

        protected void btnImportRC_Click(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();
            RutaImport = ctlRutaMayor.Text;
            sb.Append(((IImportarView)this).Presenter.ImportarMayor());

            RutaImport = ctlRutaCartola.Text;
            sb.Append(((IImportarView)this).Presenter.ImportarCartolas());
            ctlLogging.Text = sb.ToString();
        }

        #region IImportarView Members

        public string RutaImport { set; get; }

        ImportarPresenter IImportarView.Presenter
        {
            get
            {
                this.presenter = new ImportarPresenter(this);
                return this.presenter;
            }
        }

        #endregion


    }
}
